package active.mediator;

import active.iterators.College;

public class ClientMediator {


    public static void main(String[] args) {

        // 1. 创建中介者
        Mediator concreteMeditor = new ConcreteMeditor();

        // 2. 创建实体物: 如咖啡机,TV, 窗帘, 闹钟
        CoffeeMachine coffeeMachine = new CoffeeMachine(concreteMeditor, "coffeeMachine");
        Alarm alarm = new Alarm(concreteMeditor, "alarm");
        TV tv = new TV(concreteMeditor, "tv");
        Curtains curtains = new Curtains(concreteMeditor, "curtains");

        // 3. 发生行为
        alarm.sendAlarm(0);
        coffeeMachine.finishCoffee();
        alarm.sendAlarm(1);
    }


}
